API Documentation
StringView.h
1 // StringView.h
3 //
5 
6 namespace nkMemory
7 {
21  class StringView final
22  {
23  public :
24 
36  StringView (const char* data) ;
45  StringView (const char* data, unsigned long long size) ;
51  StringView (const nkLog::StringView& logStr) ;
58  StringView (const String& other) ;
63 
64  // Getters
68  const char* getData () const ;
72  unsigned long long getSize () const ;
76  bool empty () const ;
80  char front () const ;
84  char back () const ;
85 
86  // Utils
94 
95  // Operators
101  StringView& operator= (const char* data) ;
107  StringView& operator= (const String& other) ;
113  char operator[] (unsigned long long index) const ;
120  String operator+ (char c) const ;
127  String operator+ (const char* data) const ;
134  String operator+ (const StringView& other) const ;
141  bool operator== (const char* other) const ;
148  bool operator== (const StringView& other) const ;
155  bool operator!= (const char* other) const ;
162  bool operator!= (const StringView& other) const ;
163 
164  public :
165 
172  StringView (const std::string& str) ;
181  StringView (const std::string& str, unsigned long long index, unsigned long long size = 0ull) ;
188  StringView (const std::string_view& str) ;
197  StringView (const std::string_view& str, unsigned long long index, unsigned long long size = 0ull) ;
198 
199  public :
200 
204  operator std::string () const ;
208  operator std::string_view () const ;
212  operator nkLog::String () const ;
216  operator nkLog::StringView () const ;
217 
224  StringView& operator= (const std::string& data) ;
231  StringView& operator= (const std::string_view& data) ;
232  } ;
233 
241  inline bool operator== (const char* c, const nkMemory::StringView& str) ;
242 }
nkMemory::StringView::empty
bool empty() const
nkLog::StringView
Allows to exchange strings with external code.
Definition: StringView.h:18
nkMemory::StringView::~StringView
~StringView()
nkMemory::StringView::StringView
StringView(const nkLog::StringView &logStr)
nkMemory::StringView::StringView
StringView(const std::string &str, unsigned long long index, unsigned long long size=0ull)
nkMemory::StringView::StringView
StringView(const std::string_view &str)
nkMemory::StringView::split
BufferCast< StringView > split(StringView separator)
nkMemory::StringView::operator!=
bool operator!=(const char *other) const
nkMemory::StringView::StringView
StringView(const std::string &str)
nkMemory::StringView::operator[]
char operator[](unsigned long long index) const
nkMemory::StringView::StringView
StringView(const char *data)
nkMemory::StringView::operator==
bool operator==(const char *other) const
nkMemory::StringView::StringView
StringView(const char *data, unsigned long long size)
nkMemory::StringView::StringView
StringView()
nkMemory::operator==
bool operator==(const char *c, const nkMemory::String &str)
nkMemory::StringView::operator+
String operator+(char c) const
nkMemory::StringView::front
char front() const
nkMemory::StringView::getSize
unsigned long long getSize() const
nkMemory::StringView::getData
const char * getData() const
nkMemory::String
Class holding information about a string, with ownership over the data.
Definition: String.h:22
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkMemory::StringView::StringView
StringView(const std::string_view &str, unsigned long long index, unsigned long long size=0ull)
nkMemory::BufferCast
Holds a Buffer and make it easy to cast the binary data.
Definition: BufferCast.h:18
nkMemory::StringView::operator=
StringView & operator=(const char *data)
nkMemory::StringView::back
char back() const
nkMemory::StringView::StringView
StringView(const String &other)
nkMemory
Encompasses all API of component NilkinsMemory.
Definition: Allocator.h:7